/*
 * @Author: huangtianyang 916072572@qq.com
 * @Date: 2023-11-22 16:19:19
 * @LastEditors: huangtianyang
 * @LastEditTime: 2024-02-18 15:53:55
 * @FilePath: \cxl-driving-training\src\views\system\complaint\list\index.ts
 */
import { BaseData, BaseMethod } from '@/utils/basc-data'
import { tableConfig } from './config'
import { reactive, ref } from 'vue'
import { FormInstance } from 'element-plus'
import { optionsInterface } from '@/utils/dict-data'

export default class ComplaintData extends BaseData implements BaseMethod {
    dialog = reactive({
        visible: true,
        title: '查看',
        width: '80%',
        type: 'look'
    })
    progress = ref('')
    progresseOptions = reactive<optionsInterface[]>([
        { label: '待处理', value: '1' },
        { label: '已处理', value: '2' },
        { label: '处理中', value: '3' }
    ])
    appeal = ref('')
    activities = [
        {
            content: 'Custom icon',
            timestamp: '2018-04-12 20:46',
            size: 'large',
            type: 'primary'
        },
        {
            content: 'Custom color',
            timestamp: '2018-04-03 20:46',
            color: '#0bbd87'
        },
        {
            content: 'Custom size',
            timestamp: '2018-04-03 20:46',
            size: 'large'
        },
        {
            content: 'Custom hollow',
            timestamp: '2018-04-03 20:46',
            type: 'primary',
            hollow: true
        },
        {
            content: 'Default node',
            timestamp: '2018-04-03 20:46'
        }
    ]
    constructor() {
        super(tableConfig)
        this.getData()
    }
    getData = (arg?: any) => {}
    onSearch = (arg?: any) => {
        console.log(arg)
        this.getData()
    }
    onReset = (arg?: any) => {
        this.getData()
    }
    onPaginationChange = (arg?: any) => {
        this.pageData.pagination.pageNo = arg
        this.getData()
    }
    onPaginationSize = (arg?: any) => {
        this.pageData.pagination.pageNo = 1
        this.pageData.pagination.pageSize = arg
        this.getData()
    }
    onOperation = (arg?: any) => {
        const { type, data } = arg
        console.log(type, data)
        this.dialog.visible = true
        this.dialog.type = type
        this.dialog.title = type === 'edit' ? '编辑' : '查看'
    }
    //监听弹窗关闭
    onCloseDialog = () => {
        this.dialog.visible = false
    }
    //监听弹窗点击确定按钮
    submitForm = () => {
        this.dialog.visible = false
    }
}
